﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BEGDC.MIS.Office.Excel
{
    public class XmlTable
    {
        public XmlTable()
        {
            rows = new XmlRowCollection();
        }

        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }

        private string sheet;
        public string Sheet
        {
            get
            {
                return sheet;
            }
            set
            {
                sheet = value;
            }
        }

        private XmlRowCollection rows;
        public XmlRowCollection Rows
        {
            get
            {
                return rows;
            }
            set
            {
                rows = value;
            }
        }

        public int CompareTo(object obj)
        {
            return this.name.CompareTo(((XmlTable)obj).name);
        }

        public override bool Equals(Object obj)
        {
            if (obj.GetType() == typeof(string))
            {
                return this.name.Equals(obj);
            }
            if (obj.GetType() == typeof(XmlTable))
            {
                return this.name.Equals(((XmlTable)obj).name);
            }
            return false;
        }

        public override int GetHashCode()
        {
            return this.name.GetHashCode();
        }
    }
}
